<!DOCTYPE html>
<html lang="zh_CN">
<head>
    <#include "../common/header.ftl">
    <script src="/js/plugins/ckeditor/ckeditor.js"></script>
</head>
<body>
<script type="application/javascript">
    $(function () {
        //查看文章
        $(".showBtn").click(function () {
            //获取文章内容
            var id = $(this).data("did");
            $.get('/newsCatalog/getContentById.do', {id: id}, function (data) {
                console.log(data.content);
                $(".modal-body").html(data.content);
                $("#myModal").modal('show');
            })

        })
    })
</script>

<style>
    #myModal img{
        width:100%
    }

    #myModal .modal-body{
        max-height: 600px;
        overflow-y: auto;
    }
</style>
<div class="container " style="margin-top: 20px">
    <#include "../common/top.ftl">
    <div class="row">
        <div class="col-sm-3">

            <#include "../common/menu.ftl">
        </div>
        <div class="col-sm-9">
            <div class="row">
                <div class="col-sm-12">
                    <h1 class="page-head-line">日报管理</h1>
                </div>
            </div>
            <form class="form-inline" id="searchForm" action="/newsCatalog/list.do" method="post">
                <input type="hidden" name="currentPage" id="currentPage" value="1">
                <div class="form-group">
                    <label>关键字:</label>
                    <input type="text" class="form-control" name="keyword" value="${(qo.keyword)!}"
                           placeholder="请输入标题或者地点">
                    <button id="btn_query" class="btn btn-default">
                        <span class="glyphicon glyphicon-search"></span> 查询
                    </button>
                    <a href="javascript:void(-1);" class="btn btn-success inputBtn">添加日报</a>
                </div>
            </form>

            <table class="table table-striped table-hover">
                <div class="row">
                    <tr>
                        <th>编号</th>
                        <th>标题</th>
                        <th>日报摘要</th>
                        <th>是否发布</th>
                        <th>状态</th>
                        <th>封面</th>
                        <th></th>
                    </tr>
                <#list pageInfo.list as entity>
                    <tr>
                        <td>${entity_index + 1}</td>
                        <td>${entity.title}</td>
                        <td>${entity.abstracts}</td>
                        <td>
                            <#if entity.isRelease == true>
                                是
                            <#else>
                                否
                            </#if>
                        <td>${entity.state}</td>
                        <td class="coverUrl"><img src="${entity.coverUrl}" width="30px"></td>
                        <td>
                            <a href="javascript:" class="btn btn-primary  btn-xs showBtn" data-did='${entity.id}'>
                                <span class="glyphicon glyphicon-zoom-in"></span> 查看文章
                            </a>
                        </td>
                    </tr>
                </#list>
                </div>
            </table>
            <#include "../common/page.ftl">
        </div>
    </div>
</div>

<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span>
                </button>
                <h4 class="modal-title" id="myModalLabel">查看内容</h4>
            </div>
            <div class="modal-body">
            </div>
        </div>
    </div>
</div>
